﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Strongshell.Recoil.Tests
{
	//Mocks
    public class MockInterfaceFactory : IMockInterfaceFactory
    {
        public IMockInterface Create(string arg)
        {
            throw new NotImplementedException();
        }

        public static IMockInterface Create(int arg)
        {
            throw new NotImplementedException();
        }

        public static IMockInterface Create(IMockInterface parent)
        {
            throw new NotImplementedException();
        }
    }

    public interface IMockInterfaceFactory
    {
        IMockInterface Create(string arg);
    }

    public interface IMockInterface
    {
        void Test();
    }

    public class MockInterfaceImplementation : IMockInterface
    {
        public MockInterfaceImplementation()
        {
        }

        public MockInterfaceImplementation(IMockInterface dependency)
        {
        }

        public void Test()
        {
            throw new NotImplementedException();
        }
    }

    public class MockType
    {
        public string StringProperty { get; set; }
        public IMockInterface InterfaceProperty { get; set; }
        public List<MockType> ListProperty { get; set; }

        public MockType()
        {
        }

        public MockType(string stringProperty)
        {
            StringProperty = stringProperty;
        }

        public MockType(IMockInterface interfaceProperty)
        {
            InterfaceProperty = interfaceProperty;
        }

        public void Init()
        {}
    }

    public class MockChildType : MockType
    {
        public MockChildType()
        {
        }

        public MockChildType(string stringProperty) : base(stringProperty)
        {
        }
    }

    public class MockFactoryObject
    {
        public static MockType StaticFactory()
        {
            return new MockType();
        }

        public static MockType StaticFactory(string param)
        {
            return new MockType();
        }

        public MockType InstanceFactory()
        {
            return StaticFactory();
        }
    }

    public class MockListContainerDictionary
    {
        public Dictionary<string,IMockInterface[]> Dictionary { get; set; }
        public Dictionary<CompositeKey, IMockInterface> CompositeKeyDictionary { get; set; }
    }

    public class CompositeKey
    {
        public string KeyOne { get; set; }
        public string KeyTwo { get; set; }

        public CompositeKey(string keyOne, string keyTwo)
        {
            KeyOne = keyOne;
            KeyTwo = keyTwo;
        }

        public override int  GetHashCode()
        {
            return (KeyOne + KeyTwo).GetHashCode();
        }

        public override bool Equals(object obj)
        {
            return GetHashCode() == obj.GetHashCode();
        }
    }

    public class MockDelegateContainer
    {
        public Action<String> MockAction { get; set; }
    }

    public class MockExpressionContainer
    {
        public Expression<Func<String>> MockExpression { get; set; }
    }
}
